package com.xyazm.common.constants;

/**
 * redis 分布式锁key
 * @author xuyou
 * @date: 2022/6/6 14:26
 */
public class RedisLockKeyConstants {

    /**
     * 订单支付 (预支付、订单支付回调、订单支付超时取消订单)
     */
    public static final String ORDER_PAY_KEY = "#ORDER_PAY_KEY:";

    // 订单触发履约
    public static final String ORDER_FULFILL_KEY = "#ORDER_FULFILL_KEY:";

    public static final String ORDER_WMS_RESULT_KEY = "#ORDER_WMS_RESULT_KEY:";

    public static final String CANCEL_REFUND_KEY = "#CANCEL_REFUND_KEY:";

    public static final String AFTER_SALE_ORDER_KEY = "#AFTER_SALE_ORDER_KEY:";

    /**
     * 履约
     */
    public static final String FULFILL_KEY = "#FULFILL_KEY:";

    // 处理履约后置事件
    public static final String ORDER_AFTER_FULFILL_EVENT_KEY = "#ORDER_AFTER_FULFILL_EVENT_KEY:";



    /**
     * 退款
    */
    public static final String REFUND_KEY = "#REFUND_KEY:";


    /**
     * 缺品请求锁
     */
    public static final String LACK_REQUEST_KEY = "#LACK_REQUEST_KEY:";
    /**
     * 取消支付
     */
    public static final String CANCEL_KEY = "#CANCEL_KEY:";

    /**
     * 调整库存存锁
     */
    public static final String MODIFY_PRODUCT_STOCK_KEY = "#MODIFY_PRODUCT_STOCK_KEY:";

    /**
     * 新增商品库存锁
     */
    public static final String ADD_PRODUCT_STOCK_KEY = "#ADD_PRODUCT_STOCK_KEY:";

    /**
     * 订单扣减商品库存锁
     */
    public static final String ORDER_DEDUCT_PRODUCT_STOCK_KEY = "#ORDER_DEDUCT_PRODUCT_STOCK_KEY:{0}:{1}";

    /**
     * 扣减商品库存锁（保证mysql+redis库存扣减的原子性）
     */
    public static final String DEDUCT_PRODUCT_STOCK_KEY = "#ORDER_DEDUCT_PRODUCT_STOCK_KEY:";

    /**
     * 释放商品库存锁（保证mysql+redis库存释放的原子性）
     */
    public static final String RELEASE_PRODUCT_STOCK_KEY = "#RELEASE_PRODUCT_STOCK_KEY:";


}
